import React from 'react';
import ReactDOM from 'react-dom';
import OurRecord from '~/home';
import globalData from '~/common/global';
import {OAuthCallback} from '~/oauth';
import Memo from '~/memo/memo';

let routerComponent = {
    "#memo": Memo,
    "": OurRecord,
}
console.log("will render:", location.hash)
let RenderRoot = routerComponent[location.hash]
if (!RenderRoot) {
    RenderRoot = routerComponent[""];
}

globalData.oauthData = {}
ReactDOM.render(
    <RenderRoot/>,
   document.getElementById("ourrecord")
)

// OAuthCallback((searchObj) => {
//     globalData.oauthData = searchObj;
//     ReactDOM.render(
//         <OurRecord/>,
//         document.getElementById("ourrecord")
//     )
// }, {
//     type: "WeChat",
// })
